package com.combetter.changxing.ui.activity;

import com.scwang.smartrefresh.layout.header.ClassicsHeader;
import com.combetter.changxing.R;
import com.combetter.changxing.databinding.ActivityMineRecordBinding;
import com.combetter.changxing.ui.base.BaseActivity;
import com.combetter.changxing.viewmodel.MineRecordViewModel;

/**
 * 我的-吸烟记录
 * <p>
 * Created by 深圳唐龙飞讯科技有限公司 on 2018/6/12.
 */
public class MineRecordActivity extends BaseActivity<ActivityMineRecordBinding,MineRecordViewModel>  {
    @Override
    public int setLayout() {
        return R.layout.activity_mine_record;
    }

    @Override
    public void init() {
        /**
         *  下拉刷新
         */
        mBinding.srlContent.setDisableContentWhenRefresh(true);
        mBinding.srlContent.setHeaderHeight(80);
        mBinding.srlContent.setRefreshHeader(new ClassicsHeader(this));
        mBinding.srlContent.setOnRefreshListener(refreshlayout -> mViewModel.selectUidSmokeSum(mBinding.srlContent));
//        BindingRecycleViewConfig.addOnItemClick(mBinding.rvView,this,null);
    }

    @Override
    public Class createViewModel() {
        return MineRecordViewModel.class;
    }

    @Override
    public void loadData() {
        mBinding.srlContent.autoRefresh();
    }
}
